package com.day13.a00staticdemo;

import java.util.ArrayList;

public class GetMax {
    private GetMax() {

    }

    public static int getMaxAge(ArrayList<Student> list) {
        int max = list.get(0).getAge();
        for (int i = 0; i < list.size(); i++) {
            int age = list.get(i).getAge();
            max = age > max ? max = age : max;
        }
        return max;
    }
}
